fish=input().split()
n=len(fish)
x=float(input())
for i in range(n):
    a=float(fish[i])
    if a<x:
        if a<(x/2.0):
            x+=a
        else:
            x+=(a/2)
print("%.1f" % x)